//
//  SmartController.m
//  电影er
//
//  Created by dllo on 16/6/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "SmartController.h"
#import "SmartModel.h"
#import "SmartViewCell.h"
#import "MyViewController.h"
#import "LeftViewController.h"
@interface SmartController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,retain)NSMutableArray *muarray;
@property(nonatomic,retain)NSArray *array;
@end

@implementation SmartController

- (void)viewDidLoad {
    [_muarray release];
    
    
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor redColor];
    [self creactabview];
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationItem.title = @"我的";
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.41f green:0.61f blue:0.68f alpha:1.00f];
    self.navigationController.navigationBar.titleTextAttributes=@{
                                                                  NSForegroundColorAttributeName:[UIColor blackColor],
                                                                  NSFontAttributeName:[UIFont boldSystemFontOfSize:20]
                                                                  
                                                                  };
    [self creact];
    // Do any additional setup after loading the view.
}
-(void)creactabview{
    
    
    
    
    UITableView *tableview= [[UITableView alloc]initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, self.view.frame.size.height-64) style:UITableViewStylePlain];
    tableview.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:tableview];
    tableview.delegate = self;
    tableview.dataSource = self;
    tableview.rowHeight = 50;
    [tableview registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    

}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return 3;
}

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell  = [tableView dequeueReusableCellWithIdentifier:@"cell"];
   self.array= @[@"我的电影",@"清除缓存",@"我的活动" ];
    cell.textLabel.text = [self.array objectAtIndex:indexPath.row];
    return cell;
    
}
-(void)creact{
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"注册" style:UIBarButtonItemStylePlain target:self action:@selector(rightAction:)];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"登录" style:UIBarButtonItemStylePlain target:self action:@selector(leftAction:)];
    
    
}
-(void)rightAction:(UIButton*)button{
    MyViewController *myvc = [[MyViewController alloc]init];
    
    [self.navigationController pushViewController:myvc animated:YES];
    
    
}
-(void)leftAction:(UIButton *)button{
    LeftViewController *lvc = [[LeftViewController alloc]init];
    [self.navigationController pushViewController:lvc animated:YES];
    
    
    
}





@end
